package com.hy.convenient.common;

/**
 * @Description 会员类型
 * @className VipEnum
 * @Author hdy
 * @Date 2020-12-25 15:48
 * @Version 1.0
 */
public enum VipEnum {
    /**
     * 便利会员卡
     */
    BIANL(1),
    /**
     * 百货会员卡
     */
    BAIHUO(2);
    private int vipType;

    VipEnum(int vipType) {
        this.vipType = vipType;
    }

    public int getVipType() {
        return vipType;
    }

    public void setVipType(int vipType) {
        this.vipType = vipType;
    }

    /**
     * 根据传进来的值获取对应枚举
     * @param vipType
     * @return
     */
    public static VipEnum valueOf(int vipType) {
        for (VipEnum vip:VipEnum.values()) {
            if(vip.getVipType() == vipType){
                return vip;
            }
        }
        return  null;
    }
}
